package service

import (
	"fmt"
	"time"
)

func isTest(format string) string {
	currentTime := time.Now()

	switch format {
	case "year":
		return fmt.Sprintf("%d", currentTime.Year())
	case "month":
		return fmt.Sprintf("%d", currentTime.Month())
	case "day":
		return fmt.Sprintf("%d", currentTime.Day())
	case "hour":
		return fmt.Sprintf("%d", currentTime.Hour())
	case "minute":
		return fmt.Sprintf("%d", currentTime.Minute())
	case "second":
		return fmt.Sprintf("%d", currentTime.Second())
	case "week":
		return currentTime.Weekday().String()
	case "formatDay":
		return currentTime.Format("2006-01-02")
	case "format":
		return currentTime.Format("2006-01-02 15:04:05")
	default:
		return "Invalid Format"
	}
}
